import { axios } from '@/utils/http/request'

export const registerApi = {
  list: '/scen/dev/list',
  info: '/scen/dev/info/',
  save: '/scen/dev/save',
  delete: '/scen/dev/delete/',
  cameraInfoSync: '/scen/dev/cameraInfoSync',
  moveLoc: '/scen/dev/moveLoc'
}

const maintainApi = {
  list: '/verMgt/list'
}

export function registerList (headers, params) {
  return axios({
    url: registerApi.list,
    method: 'post',
    headers,
    params
  })
}

export function registerInfo (devId) {
  return axios({
    url: registerApi.info + devId,
    method: 'get',
    headers: {
      showLoading: true
    }
  })
}

export function deleteHandle (devId) {
  return axios({
    url: registerApi.delete + devId,
    method: 'get'
  })
}

export function registerSave (params) {
  return axios({
    url: registerApi.save,
    method: 'post',
    params
  })
}

export function cameraInfoSync (params) {
  return axios({
    url: registerApi.cameraInfoSync,
    method: 'get',
    params
  })
}

export function moveLoc (params) {
  return axios({
    url: registerApi.moveLoc,
    method: 'post',
    params
  })
}

export function maintainList (headers, params) {
  return axios({
    url: maintainApi.list,
    method: 'post',
    headers,
    params
  })
}
